package com.demo.entity;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 课程实体bean
 * @author david
 *
 */
@Entity
@Table(name="course")
public class Course {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	Long id;
	
	String courseName;
	Integer teacherId;
	Integer onstate;
	String courseLabel;
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "course")//关系的维护交由对方进行处理
	//@JoinColumn(name="refCourseID"
	Set<CourseSection> courseSections;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getCourseName() {
		return courseName;
	}
	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}
	public Set<CourseSection> getCourseSections() {
		return courseSections;
	}
	public void setCourseSections(Set<CourseSection> courseSections) {
		this.courseSections = courseSections;
	}
	public Integer getTeacherId() {
		return teacherId;
	}
	public void setTeacherId(Integer teacherId) {
		this.teacherId = teacherId;
	}
	public Integer getOnstate() {
		return onstate;
	}
	public void setOnstate(Integer onstate) {
		this.onstate = onstate;
	}
	public String getCourseLabel() {
		return courseLabel;
	}
	public void setCourseLabel(String courseLabel) {
		this.courseLabel = courseLabel;
	}
	
}